<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/commons/taglibs.jsp" %>
<SCRIPT type="text/javascript">
  	$(document).ready(function(){
		$("#bankCardNo").bind("change", function(){
			var selName = $("#bankCardNo").find("option:selected").text();
			//alert(selName);
			$("#bankName").val(selName);
		})
	})
//选择事件
function S_NodeCheck(e, treeId, treeNode) {
    var zTree = $.fn.zTree.getZTreeObj(treeId),
        nodes = zTree.getCheckedNodes(true)
    var ids = '', names = ''
    
    for (var i = 0; i < nodes.length; i++) {
        ids   += ','+ nodes[i].id
        names += ','+ nodes[i].name
    }
    if (ids.length > 0) {
        ids = ids.substr(1), names = names.substr(1)
    }
    $("#staffNum").val(ids);
    var $from = $('#'+ treeId).data('fromObj')
    
    if ($from && $from.length) $from.val(names)
}
//单击事件
function S_NodeClick(event, treeId, treeNode) {
    var zTree = $.fn.zTree.getZTreeObj(treeId)
    
    zTree.checkNode(treeNode, !treeNode.checked, true, true)
    
    event.preventDefault()
}
</SCRIPT>
<div class="bjui-pageContent">
    <form action="${ctx}/management/customer/update.do" data-toggle="validate" data-reload-navtab="true">
        <input type="hidden" name="intID" value="${vo.intID}">
      	   <table class="table table-condensed table-hover" width="100%">
                <tbody>
                	 <tr>
                	 	<td colspan="2">
                	 	   <input type="hidden" id="staffNum" name="staffNum" value="${vo.staffNum}">
                	 	    <input type="hidden" name="orgCode" value="${vo.orgCode}">
                            <label class="control-label x100">签约员工：</label>
                            <input type="text" name="staffName"  readonly="readonly" data-toggle="selectztree" data-tree="#addStaffTree" data-rule="required" value="${vo.staffName}" size="30">
                            <ul id="addStaffTree" class="ztree hide" data-toggle="ztree" data-expand-all="true" data-check-enable="true" data-chk-style="radio" data-radio-type="all" data-on-check="S_NodeCheck" data-on-click="S_NodeClick">
				              	<c:forEach var="obj" items="${staffList}">
				               	 	<li data-id="${obj.staffNum}" data-pid="${vo.orgCode}">${obj.staffName}</li>
				                </c:forEach>
				            </ul>
                        </td>
                      </tr>
                	  <tr>
                	 	<td colspan="2">
                            <label class="control-label x100">客户姓名：</label>
                            <input type="text" name="custName"  data-rule="required" value="${vo.custName}" size="30">
                        </td>
                 	   </tr>
                 	   <tr>
                        <td colspan="2">
                           	 <label class="control-label x100"> &nbsp;&nbsp;性&nbsp;别&nbsp;&nbsp;&nbsp;： </label>
                     		 <select class="selectpicker show-tick" name="custSex" data-width="200"   data-toggle="selectpicker" >
                           		<c:forEach var="paramObj" items="${SYS_PSEX}">
                           			 <option value="${paramObj.value2}" <c:if test="${paramObj.value2 eq vo.custSex}">selected="selected"</c:if>>${paramObj.value1}</option>
                            	 </c:forEach>
                       		 </select>
                        </td>
                        </tr>
                	  <tr>
                	 	<td colspan="2">
                            <label class="control-label x100">出生日期：</label>
                            <input type="text" name="brithDay"  value="${vo.brithDay}" data-toggle="datepicker" data-rule="required;date" size="30">
                        </td>
                 	   </tr>
                	  <tr>
                	 	<td colspan="2">
                            <label class="control-label x100">身份证号：</label>
                            <input type="text" name="identityNum" data-rule="required" value="${vo.identityNum}" size="30" >
                        </td>
                         </tr>
                	  <tr>
                	 	<td colspan="2">
                            <label class="control-label x100">客户级别：</label>
                            <select class="selectpicker show-tick" name="custLevel"  data-width="200"  data-rule="required"  data-toggle="selectpicker" >
                           		<c:forEach var="paramObj" items="${SYS_CUSTLEVEL}">
                           			 <option value="${paramObj.value2}" <c:if test="${paramObj.value2 eq vo.custLevel}">selected="selected"</c:if>>${paramObj.value1}</option>
                            	 </c:forEach>
	                        </select>
                        </td>
                        </tr>
                	  <tr>
                	 	<td colspan="2">
                            <label class="control-label x100">联系电话：</label>
                            <input type="text" name="linkPhone"  data-rule="required" value="${vo.linkPhone}" size="30">
                        </td>
                        </tr>
                	  <tr>
                	 	<td colspan="2">
                            <label class="control-label x100">联系地址：</label>
                            <input type="text" name="linkAddress"  data-rule="required" value="${vo.linkAddress}" size="30">
                        </td>
                   </tr>
                    <tr>
                	 	<td colspan="2">
                            <label class="control-label x100">银行名称：</label>
                               <input type="hidden" id="bankName" name="bankName" value="${vo.bankName}" size="30">
                             <select class="selectpicker show-tick" name="bankCardNo" id="bankCardNo" data-width="200"  data-rule="required"  data-toggle="selectpicker" >
                           		<c:forEach var="paramObj" items="${SYS_BANKNAME}">
                           			 <option value="${paramObj.value2}" <c:if test="${paramObj.value2 eq vo.bankCardNo}">selected="selected"</c:if>>${paramObj.value1}</option>
                            	 </c:forEach>
	                        </select>
                        </td>
                    </tr>
                 	
                	 <tr>
                	 	<td colspan="2">
                            <label class="control-label x100">银行卡号：</label>
                            <input type="text" name="bankAccount" value="${vo.bankAccount}" size="30">
                        </td>
                     </tr>
                     
                </tbody>
            </table>
        </div>
    </form>
</div>

<div class="bjui-pageFooter">
    <ul>
        <li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
        <li><button type="submit" class="btn-default" data-icon="save">保存</button></li>
    </ul>
</div>